<?php

namespace App;

use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;

class admin extends Model
{
	 //这是admin模型层里的添加
     protected $table="admin";
    public static function Padd($request)
    {
           $data['name']=$request['name'];
           $data['pwd']=md5($request['pwd']);
           $data['email']=$request['email'];
           $data['fen']=$request['fen'];

           return DB::table('admin')->insert($data);
    }
     //这是admin模型层里的展示
     public static function Pshow()
    {

           return DB::table('admin')->paginate(2);
    }
    // 用户积分
    public static function PLiu($request)
    {
            $id=$request['id'];
            $flight = self::find($id);

            $flight->num = ($flight->num)+1;

            $flight->save();
           
    }
      //积分
      public static function PLius($request)
    {
            $id=$request['id'];

            return self::find($id);

           
    }
}
